// src/main.js
import { createApp } from 'vue'
import App from './App.vue'
class Calculator {
    constructor (num) {
        this.value = num
    }
    add(num){
        this.value += num
        return this
    }
    subtract(num){
        this.value -= num
        return this
    }
    multiply(num){
        this.value *= num
        return this
    }
    divide(num){
        this.value /= num
        return this
    }
    getValue(num){
        return this.value
    }
}
const calculator = new Calculator(10)
const result = calculator.add(5).subtract(2).multiply(3).divide(4).getValue()
console.log(result)
const person = {
    name:'1213',
    year:'222'
}
Object.defineProperty(person, 'name', {
    get: function () {
        return this._name
    },
    set: function (value) {
        this._name = value
        console.log('qweeqeqqe')
    },
    configurable: true,
})
person.name = '122213'

const study = {
    name:'abc'
}
const handler = {
    get(target,property){
        console.log(property+'111')
        return target[property]
    },
    set(target,property, value){
        console.log(property+"222")
        target[property] = value
        return true
    }
}
const proxyStudy = new Proxy(study,handler)
console.log(proxyStudy.name)
proxyStudy.name = '122213'
// 创建 Vue 应用并挂载到 #app
createApp(App).mount('#app')
